home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / ExploD.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  964 b   |  40 lines

  1. class classes.fx.ExploD
  2. {
  3.    var id;
  4.    var x;
  5.    var y;
  6.    var scale;
  7.    var a;
  8.    var clip;
  9.    var Name = "exploD";
  10.    function ExploD(px, py, pscale, pa, pid)
  11.    {
  12.       this.id = pid;
  13.       this.x = px;
  14.       this.y = py;
  15.       this.scale = pscale;
  16.       this.a = pa + 15;
  17.       _root.d = _root.d + 1;
  18.       this.clip = _root.attachMovie("exploD","exploD" + this.id + "Clip",_root.d + 83000);
  19.       this.clip._x = this.x;
  20.       this.clip._y = this.y;
  21.       this.clip._xscale = this.scale;
  22.       this.clip._yscale = this.scale;
  23.       this.clip._alpha = this.a;
  24.    }
  25.    function main()
  26.    {
  27.       if(random(5) == 0)
  28.       {
  29.          if(this.clip.hitTest(_root[_root.char + "Clip"]))
  30.          {
  31.             _root[_root.char].nudge(_root.randRange(-9,9),_root.randRange(-9,9),this.scale - _root.randRange(10,40));
  32.          }
  33.       }
  34.       if(this.clip.end)
  35.       {
  36.          _root.removeFX("exploD" + this.id);
  37.       }
  38.    }
  39. }
  40.